import request from "@/utils/request"
// 获取站点发货国家配置列表
export const siteCountryList = (params) => {
  return request({
    url: "/listing/site-country-list",
    method: "get",
    params,
  })
}

// 站点发货国家配置
export function bindSiteCountry(data) {
  return request({
    url: `/listing/bind-site-country`,
    method: "post",
    data,
  })
}

// ?pageSize=20&pageNum=1&total=269

export function countryGetList(params) {
  return request({
    baseURL: window.APP_GETEWAY.goods,
    url: `/base/country/get-list?pageSize=99999&pageNum=1`,
    method: "get",
    params,
  })
}

// 获取供货价导入模板
export function downloaTemplate(params) {
  return request({
    url: `/import/goods-price-import/download-template`,
    method: "get",
    params,
  })
}
// 导入供货价校验
export function goodsPriceImportCheck(data) {
  return request({
    url: `/import/goods-price-import/import-check`,
    method: "post",
    data,
  })
}
// 导入供货价
export function goodsPriceImport(data) {
  return request({
    url: `/import/goods-price-import/import`,
    method: "post",
    data,
  })
}

// 导入供货价-下载导入结果
export function downloadImportResult(params) {
  return request({
    url: `/import/goods-price-import/download-import-result`,
    method: "get",
    params,
  })
}

// 关联sku
export function relateSku(data) {
  return request({
    url: `/listing/relate-sku`,
    method: "post",
    data,
  })
}

// 在售状态批量更新
export function salesStatusUpdate(data) {
  return request({
    url: `/listing/sales-status-update`,
    method: "post",
    data,
  })
}
// sku链接可售库存更新
export function skuStockUpdate(data) {
  return request({
    url: `/listing/sku-stock-update`,
    method: "post",
    data,
  })
}

// 获取文件模板链接 模板
export function fileTemplate(params) {
  return request({
    url: `/file-template/template`,
    method: "get",
    params,
  })
}
// sku链接可售库存更新 批量导入
export function importImport(data) {
  return request({
    url: `/import/import`,
    method: "post",
    data,
  })
}
// sku链接可售库存更新 导入数据验证
export function importImportCheck(data) {
  return request({
    url: `/import/import-check`,
    method: "post",
    data,
  })
}
// sku链接可售库存更新 导入结果导出
export function importDownloadImportResult(params) {
  return request({
    url: `/import/download-import-result`,
    method: "get",
    params,
  })
}

// 编辑可售库存数量调0配置
export function detectionConfig(data) {
  return request({
    url: `/listing/sales-inventory-detection-config`,
    method: "post",
    data,
  })
}
// 获取可售库存数量调0配置
export const detectionConfigList = (params) => {
  return request({
    url: "/listing/sales-inventory-detection-config-list",
    method: "get",
    params,
  })
}

export function warehouseInventoryList(data) {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: `/api/warehouse-inventory-list`,
    method: "post",
    data,
  })
}
